package cn.tedu.stu;
//SpringMVC
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/*
   Controller类:学生管理系统表单
 */
@RestController
@RequestMapping("stu")
@CrossOrigin  //跨域Access问题
public class StuController {
    //stuform.html的提交路径,会执行此方法的业务
    @RequestMapping("add")
      public  void  add(Student s){//传Student对象进去

          System.out.println(s);  //后台打印
          /*填完前端访问的表单学生管理系统之后，后台打印效果【直接提交表单的打印结果】
         Student{name='李向东', age=24, sex='0', hobby=[乒乓球, 爬山], edu='本科', intime=Wed Jul 14 00:00:00 CST 2021}
           */
      }
      @RequestMapping("obj")
      public  Student obj(Student s){//传Student对象进去
          System.out.println(s);//后台打印
        return s;  //返回对象给前端打印；F12
      }

}
